export namespace dto {
	
	export class SerialInfo {
	    port: string;
	    baud_rate: number;
	    data_bits: number;
	    parity: number;
	    stop_bits: number;
	
	    static createFrom(source: any = {}) {
	        return new SerialInfo(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.port = source["port"];
	        this.baud_rate = source["baud_rate"];
	        this.data_bits = source["data_bits"];
	        this.parity = source["parity"];
	        this.stop_bits = source["stop_bits"];
	    }
	}
	export class SshInfo {
	    host: string;
	    username: string;
	    password: string;
	
	    static createFrom(source: any = {}) {
	        return new SshInfo(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.host = source["host"];
	        this.username = source["username"];
	        this.password = source["password"];
	    }
	}
	export class StockPage {
	    page: number;
	    row: number;
	    count: number;
	    data: any;
	
	    static createFrom(source: any = {}) {
	        return new StockPage(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.page = source["page"];
	        this.row = source["row"];
	        this.count = source["count"];
	        this.data = source["data"];
	    }
	}
	export class WriteSN {
	    line: number;
	    product: number;
	    model: number;
	    model_code: number;
	    wt: number;
	    sn: string;
	    serial?: SerialInfo;
	    ssh?: SshInfo;
	
	    static createFrom(source: any = {}) {
	        return new WriteSN(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.line = source["line"];
	        this.product = source["product"];
	        this.model = source["model"];
	        this.model_code = source["model_code"];
	        this.wt = source["wt"];
	        this.sn = source["sn"];
	        this.serial = this.convertValues(source["serial"], SerialInfo);
	        this.ssh = this.convertValues(source["ssh"], SshInfo);
	    }
	
		convertValues(a: any, classs: any, asMap: boolean = false): any {
		    if (!a) {
		        return a;
		    }
		    if (a.slice && a.map) {
		        return (a as any[]).map(elem => this.convertValues(elem, classs));
		    } else if ("object" === typeof a) {
		        if (asMap) {
		            for (const key of Object.keys(a)) {
		                a[key] = new classs(a[key]);
		            }
		            return a;
		        }
		        return new classs(a);
		    }
		    return a;
		}
	}

}

export namespace httpx {
	
	export class LoginRequest {
	    account: string;
	    password: string;
	
	    static createFrom(source: any = {}) {
	        return new LoginRequest(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.account = source["account"];
	        this.password = source["password"];
	    }
	}

}

export namespace server {
	
	export class TestCanData {
	    id: string;
	    data: string;
	
	    static createFrom(source: any = {}) {
	        return new TestCanData(source);
	    }
	
	    constructor(source: any = {}) {
	        if ('string' === typeof source) source = JSON.parse(source);
	        this.id = source["id"];
	        this.data = source["data"];
	    }
	}

}

